//*************************************************************************//
//*           _____   ____________            ______               __     *//
//*          / /__ \ / ____/ ____/           / ____/___  _________/ /     *//
//*     __  / /__/ // __/ / __/    ______   / /_  / __ \/ ___/ __  /      *//
//*    / /_/ // __// /___/ /___   /_____/  / __/ / /_/ / /  / /_/ /       *//
//*    \____//____/_____/_____/           /_/    \____/_/   \__,_/        *//
//*                                                                       *//
//*     Copyright (c) 2006 Ford Argentina. All Rights Reserved.           *//
//*                                                                       *//
//*************************************************************************//

package ar.com.ford.it.webengine.websession;

import java.util.Date;
import ar.com.ford.it.webengine.wslx.WslxUser;
import com.ford.it.logging.ILogger;
import com.ford.it.logging.LogFactory;

/**
 * WebSession <br>
 * Sesion interna, que tiene correspondencia uno a uno con la HttpSession generada por el Application Server. <br>
 * 
 * @author Aji
 */
public class WebSession {

    private static final String CLASS_NAME = WebSession.class.getName();
    private static final ILogger log = LogFactory.getInstance().getLogger(CLASS_NAME);

    
    private String ipAddress;
    private String app_name;
    private WslxUser user;
    private Date lastRequest;
    
    /**
     * Constructor
     */
    public WebSession(String ipAddress, WslxUser user, String app_name) {
        String METHOD_NAME = "WebSession";
        log.entering(CLASS_NAME, METHOD_NAME);
        
        this.app_name = app_name;
        this.ipAddress = ipAddress; 
        this.user = user;

		log.exiting(CLASS_NAME, METHOD_NAME);
    }

    
    
	/**
	 * Returns the ipAddress.
	 * @return ipAddress
	 */
	public String getIpAddress() {
		return ipAddress;
	}

	/**
	 * Returns the user.
	 * @return WslxUser
	 */
	public WslxUser getUser() {
		return user;
	}

	/**
	 * Returns the lastRequest.
	 * @return lastRequest
	 */
	public Date getLastRequest() {
		return lastRequest;
	}



	/**
	 * Returns the app_name.
	 * @return app_name
	 */
	public String getApp_name() {
		return app_name;
	}


	/**
	 * Actualiza el tiempo del ultimo acceso
	 * @param lastRequest Tiempo del ultimo acceso registrado 
	 */
	public void setLastRequest(Date lastRequest) {
		this.lastRequest = lastRequest;
	}


}